<div class="users form">
    <fieldset>
<legend>Usuarios</legend>
<table>
    <thead>
		<tr>
			
			<th><?php echo $this->Paginator->sort('username', 'Usuario');?>  </th>
			<th><?php echo $this->Paginator->sort('email', 'E-Mail');?></th>
			<th><?php echo $this->Paginator->sort('created', 'Creado');?></th>
			<th><?php echo $this->Paginator->sort('modified','Ultima Modificacion');?></th>
			<th><?php echo $this->Paginator->sort('role','Role');?></th>
			<th><?php echo $this->Paginator->sort('estado','Estado');?></th>
			<th>Actions || Activar  </th>
                       
		</tr>
	</thead>
	<tbody>						
		<?php $count=0; ?>
		<?php foreach($users as $user): ?>				
		<?php $count ++;?>
		<?php if($count % 2): echo '<tr>'; else: echo '<tr class="zebra">' ?>
		<?php endif; ?>
			
			<td><?php echo $this->Html->link( $user['User']['username']  ,   array('action'=>'edit', $user['User']['id']),array('escape' => false) );?></td>
			<td style="text-align: center;"><?php echo $user['User']['email']; ?></td>
			<td style="text-align: center;"><?php echo $this->Time->niceShort($user['User']['created']); ?></td>
			<td style="text-align: center;"><?php echo $this->Time->niceShort($user['User']['modified']); ?></td>
			<td style="text-align: center;"><?php echo $user['User']['role_id']; ?></td>
			<td style="text-align: center;"><?php echo $user['User']['estado']; ?></td>
			<td class="actions" >
                            <?php echo $this->Html->link(__('Editar'), array('action' => 'edit',$user['User']['id']), array('class'=>'edit')); ?>
							<?php echo $this->Html->link(__('View'), array('action' => 'view',$user['User']['id']), array('class'=>'view')); ?>
			
			<?php
				if( $user['User']['estado'] != 0) {
                                    
                                     echo $this->Form->postLink(__('Eliminar'), array('action' => 'delete', $user['User']['id']), array('class'=>'delete'), __('Desea Eliminar?'));
                                }
					echo $this->Form->postLink("Re-Activar", array('action'=>'activate', $user['User']['id']),array('class'=>'activar'));
					
			?>
			</td>
		
		<?php endforeach; ?>
		<?php unset($user); ?>
	</tbody>
</table>
</fieldset>


<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>				
